home *** CD-ROM | disk | FTP | other *** search
/ Champak 147 / (Vol 147) Jan 21 2012.iso / Interface / it.dig / scripts / __Packages / mx / controls / gridclasses / DataGridColumn.as next >
Text File  |  2012-01-21  |  3KB  |  127 lines

  1. class mx.controls.gridclasses.DataGridColumn extends mx.styles.CSSStyleDeclaration
  2. {
  3.    var editable = true;
  4.    var sortable = true;
  5.    var resizable = true;
  6.    var sortOnHeaderRelease = true;
  7.    var __width = 50;
  8.    function DataGridColumn(colName)
  9.    {
  10.       super();
  11.       this.columnName = colName;
  12.       this.__set__headerText(colName);
  13.    }
  14.    function get width()
  15.    {
  16.       return this.__width;
  17.    }
  18.    function set width(w)
  19.    {
  20.       delete this.parentGrid.invSpaceColsEqually;
  21.       if(this.parentGrid != undefined && this.parentGrid.hasDrawn)
  22.       {
  23.          var _loc2_ = this.resizable;
  24.          this.resizable = false;
  25.          this.parentGrid.resizeColumn(this.colNum,w);
  26.          this.resizable = _loc2_;
  27.       }
  28.       else
  29.       {
  30.          this.__width = w;
  31.       }
  32.    }
  33.    function set headerText(h)
  34.    {
  35.       this.__header = h;
  36.       this.headerCell.setValue(h);
  37.    }
  38.    function get headerText()
  39.    {
  40.       return this.__header != undefined ? this.__header : this.columnName;
  41.    }
  42.    function set cellRenderer(cR)
  43.    {
  44.       this.__cellRenderer = cR;
  45.       this.parentGrid.invColChange = true;
  46.       this.parentGrid.invalidate();
  47.    }
  48.    function get cellRenderer()
  49.    {
  50.       return this.__cellRenderer;
  51.    }
  52.    function set headerRenderer(hS)
  53.    {
  54.       this.__headerRenderer = hS;
  55.       this.parentGrid.invInitHeaders = true;
  56.       this.parentGrid.invalidate();
  57.    }
  58.    function get headerRenderer()
  59.    {
  60.       return this.__headerRenderer;
  61.    }
  62.    function set labelFunction(f)
  63.    {
  64.       this.__labelFunction = f;
  65.       this.parentGrid.invUpdateControl = true;
  66.       this.parentGrid.invalidate();
  67.    }
  68.    function get labelFunction()
  69.    {
  70.       return this.__labelFunction;
  71.    }
  72.    function getStyle(prop)
  73.    {
  74.       var _loc3_ = this[prop];
  75.       if(_loc3_ == undefined)
  76.       {
  77.          if(this.styleName != undefined)
  78.          {
  79.             if(this.styleName instanceof mx.styles.CSSStyleDeclaration)
  80.             {
  81.                _loc3_ = this.styleName.getStyle(prop);
  82.             }
  83.             else
  84.             {
  85.                _loc3_ = _global.styles[this.styleName].getStyle(prop);
  86.             }
  87.          }
  88.          if((_loc3_ == undefined || _loc3_ == _global.style[prop] || _loc3_ == _global.styles[this.parentGrid.className][prop]) && prop != "backgroundColor")
  89.          {
  90.             _loc3_ = this.parentGrid.getStyle(prop);
  91.          }
  92.       }
  93.       return _loc3_;
  94.    }
  95.    function __getTextFormat(tf, bAll, fieldInst)
  96.    {
  97.       var _loc4_ = undefined;
  98.       if(this.parentGrid.header_mc[fieldInst._name] != undefined)
  99.       {
  100.          _loc4_ = this.getStyle("headerStyle").__getTextFormat(tf,bAll,fieldInst);
  101.          if(_loc4_ != false)
  102.          {
  103.             _loc4_ = this.parentGrid.getStyle("headerStyle").__getTextFormat(tf,bAll,fieldInst);
  104.          }
  105.          if(_loc4_ == false)
  106.          {
  107.             return _loc4_;
  108.          }
  109.       }
  110.       if(this.styleName != undefined)
  111.       {
  112.          var _loc8_ = typeof this.styleName != "string" ? this.styleName : _global.styles[this.styleName];
  113.          _loc4_ = _loc8_.__getTextFormat(tf,bAll);
  114.          if(!_loc4_)
  115.          {
  116.             return _loc4_;
  117.          }
  118.       }
  119.       _loc4_ = super.__getTextFormat(tf,bAll,fieldInst);
  120.       if(_loc4_)
  121.       {
  122.          return this.parentGrid.__getTextFormat(tf,bAll);
  123.       }
  124.       return _loc4_;
  125.    }
  126. }
  127.